#include<iostream>
#include<bits/stdc++.h>
#define lowbit(i) i&(-i)
#define VI vector<int>

using namespace std;

const int MAXN=2000005;
VI p[MAXN];
VI depcnt[MAXN];
int n,m,in[MAXN],out[MAXN],dep[MAXN],cnt;
int a[MAXN];
int c[MAXN];

int dfs(int x){
	in[x]=++cnt;
	for(int i=0;i<p[x].size();i++){
        if(!in[p[x][i]]){
            dfs(p[x][i]);
        }
    }
	out[x]=cnt;
}


int getsum(int x){
	int sum=0;
	for(int k=x;k>0;k-=lowbit(k))sum+=c[k];
	return sum;
}

void modify(int x,int d){
	for(int i=x;i<=n;i+=lowbit(i)){
		c[i]+=d;
	}
}
inline int read(){
    int x;
    scanf("%d",&x);
    return x;
}
int main(){
    //freopen("d.in","r",stdin);
	cin>>n>>m;
    memset(c,0,sizeof(c));
    for(int i=1;i<=n;i++){
       cin>>c[i];
    }
    for(int i=1;i<n;i++){
        int x=read(),y=read();
        p[x].push_back(y);
        p[y].push_back(x);
    }
    cout<<"test"<<endl;
    dfs(1);
    for(int i=1;i<=m;i++){
        int x;
        cin>>x;
        //change point number
        if(x==1){
            int a,b;
            cin>>a>>b;
            in[a]+=b;
        }
        //change son tree
        else if(x==2){
            int a,b;
            cin>>a>>b;
            out[a]+=b;
        }
        //output x to root sum
        else {
            int a;
            cin>>a;
            cout<<getsum(a)<<endl;
        }
    }
	return 0;
}